package com.ruan.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruan.entity.Question;
import com.ruan.entity.R;
import com.ruan.query.QuestionQuery;
import com.ruan.service.QuestionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName:QuestionController
 * @Author:阮昇
 * @Description:
 * @Datetime: 2023/10/7 16:44
 **/
@RestController
@RequestMapping("/question")
@Api(tags = "提问相关接口")
public class QuestionController {

    @Autowired
    private QuestionService questionService;

    @ApiOperation(value = "分页，模糊查询提问列表")
    @ApiImplicitParam(name = "page", value = "提问查询类", required = true, dataType = "QuestionQuery")
    @PostMapping("/queryQuestions")
    public R<IPage<Question>> queryQuestions(@RequestBody QuestionQuery questionQuery){
        return questionService.queryQuestions(questionQuery);
    }
}
